from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QWidget, QStackedWidget, QGridLayout
from qfluentwidgets import VBoxLayout

from app.components.widgets.scrollarea import ScrollArea


def ClickableLabel(param):
    pass


class LabelNavigationInterface(QWidget):
    """标签导航界面"""

    label_clicked = pyqtSignal(str)

    def __init__(self, parent=None, label_list=None):
        super().__init__(parent=parent)
        self.scroll_widget = QWidget(self)
        self.scroll_area = ScrollArea(self)
        self.stack_widget = QStackedWidget(self)
        self.vBox = VBoxLayout(self.scrollWidget)
        self.letterNavigationWidget = QWidget(self)
        self.gridLayout = QGridLayout(self.letterNavigationWidget)
        self.__clickableLabels = []  # type:List[ClickableLabel]
        self.__clickableLetterLabels = [
            ClickableLabel(chr(i)) for i in range(65, 91)]  # type:List[ClickableLabel]
        self.__clickableLetterLabels.append(ClickableLabel("..."))

        self.set_labels(label_list)
        self.__init_widget()
